/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once


#include "../../../S_Physics.h"
#include "../A_核心/NewTon核心.h"
#include "NewTon几何.h"




struct S_NewTon刚体 : public S_物理体 {
	NewtonBody* m_刚体;

	S_NewTon刚体(S_NewTon核心* core, S_物理几何体& geom, S_物理材质& 材质, uint32 key = 0);
	~S_NewTon刚体();



	void* f_getBody() { return m_刚体; }
	//inline void* f_get关联对象() { return m_Shape->userData; }
	//inline void		f_冻结(bool no) { m_刚体->setActorFlag(physx::PxActorFlag::eDISABLE_SIMULATION, no); }

	//void f_构建(S_Px物理引擎核心* core, const S_三角Mesh mesh, const vec3& loc, const vec4& rot, const vec3& scale);
	void f_绑定关联对象(void* data) {
		NewtonBodySetUserData(m_刚体, data);
	}

	//void f_setLocation(const vec3& loc);
	//void f_setRot(const vec3& loc);
	void f_setLocRot(const vec3& loc, const vec3& r);
	void f_setPos(const vec3& l);
	void f_setRot(const vec3& r);
	void f_setVel(const vec3& l);
	vec3 f_getLocation();

};














struct S_NewTon静态 : public S_物理体 {
	NewtonBody* m_刚体;

	S_NewTon静态(S_NewTon核心* core, S_物理几何体& geom, S_物理材质& 材质, uint32 key = 0);
	~S_NewTon静态();



	void* f_getBody() { return m_刚体; }
	//inline void* f_get关联对象() { return m_Shape->userData; }
	//inline void		f_冻结(bool no) { m_刚体->setActorFlag(physx::PxActorFlag::eDISABLE_SIMULATION, no); }

	//void f_构建(S_Px物理引擎核心* core, const S_三角Mesh mesh, const vec3& loc, const vec4& rot, const vec3& scale);
	void f_绑定关联对象(void* data) {
		NewtonBodySetUserData(m_刚体, data);
	}

	//void f_setLocation(const vec3& loc);
	//void f_setRot(const vec3& loc);
	void f_setLocRot(const vec3& loc, const vec3& r);
	void f_setPos(const vec3& l);
	void f_setRot(const vec3& r);
	void f_setVel(const vec3& l);
	vec3 f_getLocation();

};











